001 /*
002 * Copyright 2005 Stephen J. McConnell.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
013 * implied.
014 *
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018
019 package net.dpml.transit.model;
020
021 import java.util.EventObject;
022 import java.net.PasswordAuthentication;
023
024 /**
025 * An event pertaining to the Transit proxy configuration.
026 *
027 * @author <a href="http://www.dpml.net">Digital Product Meta Library</a>
028 * @version 1.0.2
029 */
030 public class ProxyEvent extends EventObject
031 {
032 /**
033 * Serial version identifier.
034 */
035 static final long serialVersionUID = 1L;
036
037 private final RequestIdentifier m_identifier;
038 private final PasswordAuthentication m_authentication;
039 private final String[] m_excludes;
040
041 /**
042 * Creation of a new ProxyEvent.
043 * @param model the proxy model
044 * @param identifier the request identifier
045 * @param auth the password authentifcation credentials
046 * @param excludes the set of proxy host excludes
047 */
048 public ProxyEvent(
049 ProxyModel model, RequestIdentifier identifier,
050 PasswordAuthentication auth, String[] excludes )
051 {
052 super( model );
053
054 m_identifier = identifier;
055 m_authentication = auth;
056 m_excludes = excludes;
057 }
058
059 /**
060 * Return the proxy model that is the subject of change.
061 * @return the proxy model
062 */
063 public ProxyModel getProxyModel()
064 {
065 return (ProxyModel) super.getSource();
066 }
067
068 /**
069 * Return the proxy model request identifier.
070 * @return the proxy model request identifier
071 */
072 public RequestIdentifier getRequestIdentifier()
073 {
074 return m_identifier;
075 }
076
077 /**
078 * Return the proxy model password authentication.
079 * @return the proxy model password authentication
080 */
081 public PasswordAuthentication getPasswordAuthentication()
082 {
083 return m_authentication;
084 }
085
086 /**
087 * Return the proxy model excludes.
088 * @return the proxy model excludes
089 */
090 public String[] getExcludes()
091 {
092 return m_excludes;
093 }
094 }